<?php
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/../app/lib');

function __autoload($argClassName) {
    require_once str_replace('_', '/', $argClassName).'.php';
}


//error_reporting(E_ALL|E_ERROR|E_STRICT);
error_reporting(E_ALL);
set_time_limit(0);
ob_implicit_flush();

$oSrv = Randstand_Net_Socket_Server::getInstance();
$oSrv->create()
     ->setOption(SOL_SOCKET, SO_REUSEADDR, 1)
     ->setBlocking(false)
     ->setHost('localhost')
     ->setPort(8080)
     ->bind()
     ->listen();

while (true) {
    $oSrv->checkForNewClient()
         ->waitForDataFromClients(1)
         ->readDataFromClients();
}

?>